/*
 * @(#)QueryName.java
 * Date 2013-09-02
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.registry.constant;

/**
 * Enum description
 *
 */
public enum QueryName implements IQueryName {

    // XDS Stored Queries
    FindDocuments("urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d"),
    FindSubmissionSets("urn:uuid:f26abbcb-ac74-4422-8a30-edb644bbc1a9"), 
    FindFolders("urn:uuid:958f3006-baad-4929-a4de-ff1114824431"), 
    GetAll("urn:uuid:10b545ea-725c-446d-9b95-8aeb444eddf3"), 
    GetDocuments("urn:uuid:5c4f972b-d56b-40ac-a5fc-c8ca9b40b9d4"),
    GetFolders("urn:uuid:5737b14c-8a1a-4539-b659-e03a34a5e1e4"), 
    GetAssociations("urn:uuid:a7ae438b-4bc2-4642-93e9-be891f7bb155"), 
    GetDocumentsAndAssociations("urn:uuid:bab9529a-4a10-40b3-a01f-f68a615d247a"),
    GetSubmissionSets("urn:uuid:51224314-5390-4169-9b91-b1980040715a"), 
    GetSubmissionSetAndContents("urn:uuid:e8e3cb2c-e39c-46b9-99e4-c12f57260b83"),
    GetFolderAndContents("urn:uuid:b909a503-523d-4517-8acf-8e5834dfc4c7"), 
    GetFoldersForDocument("urn:uuid:10cae35a-c7f9-4cf5-b61e-fc3278ffb578"),
    GetRelatedDocuments("urn:uuid:d90e5407-b356-4d91-a89f-873917b4b0e6"),

    // TODO separate this / move to MPQ project
    // Mutipatient Stored Queries
    FindDocumentsForMultiplePatients("urn:uuid:3d1bdb10-39a2-11de-89c2-2f44d94eaa9f"),
    FindFoldersForMultiplePatients("urn:uuid:50d3f5ac-39a2-11de-a1ca-b366239e58df"),
    ;

    /** Field description */
    private final String uuid;

    /**
     * Constructs ...
     *
     *
     * @param u
     */
    private QueryName(String u) {
        this.uuid = u;
    }

    /**
     * Method description
     *
     *
     * @param uuid
     *
     * @return
     */
    public static QueryName toQueryName(String uuid) {

        QueryName result = null;

        for (QueryName myname : values()) {

            if (myname.uuid.equals(uuid)) {

                result = myname;

                break;
            }
        }

        return result;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public String getName() {
        return name();
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public String getUUID() {
        return this.uuid;
    }
}
